#!/bin/sh
echo "make mcpu $1"
CFLAGS="-w -O2 -fno-common -mcpu=cortex-$1"
#编译生成可重定位文件dry1.o
echo "${CC=gcc-11} -c ${CFLAGS} dry.c -o dry1.o"
${CC}    -c ${CFLAGS} dry.c -o dry1.o || exit 1
#编译生成可执行文件dry-$mcpu
echo "${CC} -DPASS2 ${CFLAGS} dry.c dry1.o ${LFLAGS} -o dry-$1"
${CC} -DPASS2 -O ${CFLAGS} dry.c dry1.o ${LFLAGS} -o dry-$1 || exit 1
rm -rf dry1.o